package com.swzl.model.wx.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.swzl.bean.School;
import com.swzl.common.web.request.PageDoMain;
import com.swzl.mapper.SchoolMapper;
import com.swzl.model.wx.service.SchoolService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author fog
 * @date 2024年11月03日 17:35
 */

@Service
public class SchoolServiceImpl implements SchoolService {

    @Resource
    private SchoolMapper schoolMapper;

    @Override
    public List<School> allSchoolList() {
        return schoolMapper.allList();
    }

    @Override
    public PageInfo<School> getSchoolInfo(PageDoMain pageDoMain, School school) {

        PageHelper.startPage(pageDoMain.getPage(), pageDoMain.getLimit());

        List<School> schoolList = schoolMapper.selectBy(school);

        return new PageInfo<>(schoolList);
    }

}
